﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="ncp.Web.login" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Src="uc/search.ascx" TagName="search"  TagPrefix="uc" %>
<%@ Register Src="uc/headTop.ascx" TagName="headTop"  TagPrefix="uc" %>
<%@ Register Src="uc/headLogo.ascx" TagName="headlogo"  TagPrefix="uc" %>
<%@ Register Src="uc/menu.ascx" TagName="menu"  TagPrefix="uc" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>中国农业信息化服务商</title>
    <link href="css/module.css" rel="stylesheet" type="text/css" />
    <link href="css/page.css" rel="stylesheet" type="text/css" />
    <link href="css/reset.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="js/common.js" type="text/javascript"></script>
    
</head>
<body>
    <form id="form1" runat="server">
    <!--Head Begin-->
	<!--Head Top-->
<uc:headTop id="headtop" runat="server" />
	<!--Head Logo-->
<uc:headlogo id="headlogo" runat="server" />
	<!--Head Nav-->
<div id="head-nav">
	<div id="head-nav-center">
	    <uc:menu ID="menu" runat="server"/>
        <uc:search id="search" runat="server" />
    </div>
</div>
<!--Head End-->
<!--content begin-->
	<div class="bh-p-content">
    	<div class="bh-content">
			 <div class="bh-section">
			 	<div class="bh-sidebar bh-fl">
				<!--图片-->
					<div class="bh-m-ad-img"><img src="/image/login-pic1.jpg" width="328" height="214"></div>
				</div>
				<div class="bh-sidebar bh-fr">

					<div class="bh-login">
						<div class="bh-title">
							<h3>登录</h3>
						</div>
						<div class="bh-con">
								<p class="bh-field">
									<label>用户名：</label>
									<input type="text" id="tbaccount" class="bh-input-long"/>
									<span class="msg"></span>
								</p>
								<p class="bh-field">
									<label>密码：</label>
									<input type="password" id="tbpwd" class="bh-input-long"/>
									<span class="msg"></span>
								</p>
								<div class="bh-btn">
								    <input type="button" class="bh-lr-btn" value="登 录" onclick="onlogin()"/>
									<a href="/forget_passwd.html">密码忘记了？</a>
								</div>
								<p class="bh-tips"><span class="bh-red">提示：</span>还不是商城会员？点击这里 <a class="bh-btn-lr-red" href="/register.html">免费注册</a></p>
						</div>
					</div>
				</div>

			 </div>

        </div>
    </div>
	<!--content end-->
	<!--<div class="bh-space bh-clear"></div>-->
	<!-- foot begin -->
	<!--Foot Begin-->
	<!--#include file="/uc/footer.htm"-->
<!--Foot End-->
    </form>
</body>
</html>
<script type="text/javascript">
	function onlogin() {
		var account = $("#tbaccount").val();
		var pwd = $("#tbpwd").val();
		$("span.msg").text("");
		if (isEmpty("tbaccount")) {
		    $("#tbaccount").next("span.msg").text("用户名不能为空！");
		    $("#tbaccount").focus();
			return;
		}
		if (isEmpty("tbpwd")) {
		    $("#tbpwd").next("span.msg").text("密码不能为空！");
		    $("#tbpwd").focus();
			return;
		}
		var response = ncp.Web.login.UserLogin(account, pwd);
		if (response.value!="") {
			 var jsonOBJ = eval(response.value)[0];
			if (jsonOBJ.isreload) {
	                window.location.href=jsonOBJ.msg;
	            } else
	                alert(jsonOBJ.msg);
		}
}
$(function() {
//回车触发登录按钮
$("#tbaccount,#tbpwd").keypress(function(e) {
    var key = window.event ? e.keyCode : e.which;
    if (key.toString() == "13") {
        onlogin();
        return false;
    }
});
	});
</script>
